var returnId;
function BrowseServer(id)
{
	returnId = id;
	OpenServerBrowser(
		'Template',
		FCKConfig.TemplateBrowserURL,
		FCKConfig.TemplateBrowserWindowWidth,
		FCKConfig.TemplateBrowserWindowHeight ) ;
}
function BrowseServerImg(id)
{
	returnId = id;
	OpenServerBrowser(
		'Image',
		FCKConfig.CjImageBrowserURL,
		FCKConfig.CjImageBrowserWindowWidth,
		FCKConfig.CjImageBrowserWindowHeight ) ;
}
function OpenServerBrowser( type, url, width, height)
{
	sActualBrowser = type ;
	// oEditor must be defined.

	var iLeft = ( FCKConfig.ScreenWidth  - width ) / 2 ;
	var iTop  = ( FCKConfig.ScreenHeight - height ) / 2 ;

	var sOptions = "toolbar=no,status=no,resizable=yes,dependent=yes,scrollbars=yes" ;
	sOptions += ",width=" + width ;
	sOptions += ",height=" + height ;
	sOptions += ",left=" + iLeft ;
	sOptions += ",top=" + iTop ;

	window.open( url, 'FCKBrowseWindow', sOptions ) ;
}
function SetUrl(fileUrl){
	$('#'+returnId).val(fileUrl);
}
